package com.nami.gchat.client.response;

import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 描述：
 *
 * @Author: lbc
 * @Date: 2023-08-17 16:16
 * @email: 594599620@qq.com
 * @Description: keep coding
 */
@Data
public class GrpMemberDTO implements Serializable {

    private static final long serialVersionUID = 2445118353977563746L;

    private Long id;

    /**
     * 群no
     */
    private String groupId;

    /**
     * 群成员用户id
     */
    private String userId;

    /**
     * 用户在群中的昵称
     */
    private String nickName;

    /**
     * 是否是群主
     */
    private Boolean ifGroupLeader;

    /**
     * 是否是管理员
     */
    private Boolean ifManager;

    /**
     * 是否屏蔽群
     */
    private Boolean ifBanGroup;

    /**
     * 是否被禁言
     */
    private Boolean banSpeak;

    /**
     * 已读得seq
     */
    private Long readSeq;

    /**
     * 最后发言时间
     */
    private Date lastSpeakTime;

    /**
     * 是否软删除
     */
    private Boolean deleted;

    /**
     * 创建时间
     */
    private Date createTime;

    public GrpMemberDTO() {
    }

    /**
     * 深拷贝构造函数
     *
     * @param other 要拷贝的GroupMember对象
     */
    public GrpMemberDTO(GrpMemberDTO other) {
        this.id = other.id;
        this.groupId = other.groupId;
        this.userId = other.userId;
        this.nickName = other.nickName;
        this.ifGroupLeader = other.ifGroupLeader;
        this.ifManager = other.ifManager;
        this.ifBanGroup = other.ifBanGroup;
        this.banSpeak = other.banSpeak;
        this.readSeq = other.readSeq;
        if (other.lastSpeakTime != null) {
            this.lastSpeakTime = new Date(other.lastSpeakTime.getTime());
        }
        if (other.createTime != null) {
            this.createTime = new Date(other.createTime.getTime());
        }

        this.deleted = other.deleted;

    }

    /**
     * 深拷贝方法
     *
     * @return 拷贝后的GroupMember对象
     */
    public GrpMemberDTO clone() {
        return new GrpMemberDTO(this);
    }


}
